package com.wg.code.service;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wg.code.model.dto.app.AppAddRequest;
import com.wg.code.model.dto.app.AppQueryRequest;
import com.wg.code.model.entity.App;
import com.wg.code.model.entity.User;
import com.wg.code.model.vo.AppVO;
import reactor.core.publisher.Flux;

import java.util.List;

/**
* @author Wait葡萄成熟时
* @description 针对表【app(应用)】的数据库操作Service
* @createDate 2025-08-11 15:08:46
*/
public interface AppService extends IService<App> {

    /**
     * 获取查询条件
     *
     * @param appQueryRequest
     * @return
     */
    QueryWrapper<App> getQueryWrapper(AppQueryRequest appQueryRequest);

    /**
     * 获取精选应用查询条件
     *
     * @param appQueryRequest
     * @return
     */
    QueryWrapper<App> getGoodAppQueryWrapper(AppQueryRequest appQueryRequest);


    AppVO getAppVO(App app);

    List<AppVO> getAppVOList(List<App> appList);
    /**
     *  通过应用生成代码
     *
     * @param message
     * @param loginUser
     * @param appId
     * @return Flux<String>
     */
    Flux<String> chatToGenCode(Long appId, String message, User loginUser);
    /**
     * 部署项目，返回可访问的地址
     **/
    String deployApp(Long appId, User loginUser);

    void generateAppScreenshotAsync(Long appId, String appUrl);

    Long createApp(AppAddRequest appAddRequest, User loginUser);
}
